package com.kedacom.demo.modb.ap.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.kedacom.demo.modb.ap.model.Account;
import com.kedacom.demo.modb.ap.service.AccountService;

@Controller
@RequestMapping("/account")
public class AccountController {

	@Resource
	private AccountService accountService;

	@RequestMapping(value = "/list")
	public String list(Model model) {
		List<Account> accounts = accountService.listAll();
		model.addAttribute("accounts", accounts);
		return "account/list";
	}

}
